export function canBoxFit(
  item: [number, number, number],
  container: [number, number, number]
): boolean {
  // Get all possible rotations of the item
  const rotations = getAllRotations(item);
  
  // Check if any rotation fits in the container
  return rotations.some(rotation =>
    rotation[0] <= container[0] &&
    rotation[1] <= container[1] &&
    rotation[2] <= container[2]
  );
}

function getAllRotations(dimensions: [number, number, number]): [number, number, number][] {
  const [w, h, d] = dimensions;
  return [
    [w, h, d],
    [w, d, h],
    [h, w, d],
    [h, d, w],
    [d, w, h],
    [d, h, w]
  ];
}